SUBROUTINE TABLE_S6
     * Demonstrate using a table to lay out a form.

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     EQU AM TO CHAR(254)

     * Start the HTML page.
     CALL RW_START_HTML_PAGE("Table/Form Layout Example", "", "", "", "")

     TABLE = ""

     * Create the form elements and put them into table cells.
     CELL1 = "Name:"
     aClass = ""
     aClass<2> = "RIGHT"        ;* Right align the cell contents.
     CALL RWS_TABLE_HEADER(CELL1, aClass)
     CELL2 = ""
     CALL RWA_EDIT_BOX(CELL2, "name", 32, "")
     CALL RWS_TABLE_DATA(CELL2, "")
     ROW = CELL1 : CELL2
     CALL RWS_TABLE_ROW(ROW, "")      ;* Construct the table row.
     TABLE = TABLE : ROW

     CELL1 = "Address:"
     aClass = ""
     aClass<2> = "RIGHT"        ;* Right align the cell contents.
     CALL RWS_TABLE_HEADER(CELL1, aClass)
     CELL2 = ""
     CALL RWA_EDIT_BOX(CELL2, "address", 32, "")
     CALL RWS_TABLE_DATA(CELL2, "")
     ROW = CELL1 : CELL2
     CALL RWS_TABLE_ROW(ROW, "")      ;* Construct the table row.
     TABLE = TABLE : ROW

     CELL1 = "Phone:"
     CALL RWS_TABLE_HEADER(CELL1, aClass)
     CELL2 = ""
     CALL RWA_EDIT_BOX(CELL2, "phone", 32, "")
     CALL RWS_TABLE_DATA(CELL2, "")
     ROW = CELL1 : CELL2
     CALL RWS_TABLE_ROW(ROW, "")      ;* Construct the table row.
     TABLE = TABLE : ROW

     CELL1 = "Preferences:"
     aClass = ""
     aClass<3> = "TOP"                ;* Put the cell contents at the top.
     CALL RWS_TABLE_HEADER(CELL1, aClass)
     ROW = CELL1

     * The next cell will contain an embedded table, containing
     * four check boxes.
     TABLE2 = ""
     CELL1 = ""
     CALL RWA_CHECKBOX(CELL1, "pref", "CR", 0, 4, "")
     CELL1 = CELL1 : "Crime and Thrillers"
     CALL RWS_TABLE_DATA(CELL1, "")
     CELL2 = ""
     CALL RWA_CHECKBOX(CELL2, "pref", "HI", 0, 4, "")
     CELL2 = CELL2 : "Historical"
     CALL RWS_TABLE_DATA(CELL2, "")
     ROW2 = CELL1 : CELL2
     CALL RWS_TABLE_ROW(ROW2, "")      ;* Construct the table row.
     TABLE2 = TABLE2 : ROW2

     CELL1 = ""
     CALL RWA_CHECKBOX(CELL1, "pref", "CL", 0, 4, "")
     CELL1 = CELL1 : "Classics"
     CALL RWS_TABLE_DATA(CELL1, "")
     CELL2 = ""
     CALL RWA_CHECKBOX(CELL2, "pref", "SF", 0, 4, "")
     CELL2 = CELL2 : "Science Fiction"
     CALL RWS_TABLE_DATA(CELL2, "")
     ROW2 = CELL1 : CELL2
     CALL RWS_TABLE_ROW(ROW2, "")      ;* Construct the table row.
     TABLE2 = TABLE2 : ROW2

     * Create the embedded table.
     CALL RWS_TABLE(TABLE2, "")
     * Put it in a table cell.
     CALL RWS_TABLE_DATA(TABLE2, "")
     ROW = ROW : TABLE2
     * Construct the table row.
     CALL RWS_TABLE_ROW(ROW, "")      ;* Construct the table row.
     TABLE = TABLE : ROW

     ROW = ""
     CALL RWA_SUBMIT_BUTTON(ROW, "Register", "")
     aClass = ""
     aClass<2> = "CENTER"       ;* Centre the cell contents.
     aClass<4> = 2              ;* Span two columns.
     CALL RWS_TABLE_DATA(ROW, aClass)
     CALL RWS_TABLE_ROW(ROW, "")      ;* Construct the table row.
     TABLE = TABLE : ROW

     * Construct the table.
     CALL RWS_TABLE(TABLE, "")

     * Construct the form.
     CALL RWS_FORM(TABLE, "THANKS", "Details", "")

     * Output the HTML.
     CALL RW_PUT(TABLE)

     * Complete the page.
     CALL RW_END_PAGE
RETURN

Go to top button